<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title> nice validator验证表单实例</title>
		<meta name="Generator" content="EditPlus">
		<meta name="Author" content="">
		<meta name="Keywords" content="">
		<meta charset="utf-8"/>
		<link rel="stylesheet" href="../../resources/validator-0.6.6/jquery.validator.css">
		<script src="../../resources/validator-0.6.6/jquery-1.10.2.min.js"></script>
		<script type="text/javascript" src="../../resources/validator-0.6.6/jquery.validator.js"></script>
		<script type="text/javascript" src="../../resources/validator-0.6.6/local/zh_CN.js"></script>

	</head>

	<body>
		<h2>nice validator 验证表单</h2>
		<h3>1、基本用法</h3>
		<form id="demo_11" action="results.php" method="post" autocomplete="off">
			<fieldset>
				<p>
					用户名：
					<input name="user[name]" data-rule="required;username" placeholder="用户名"/>
				</p>
				<p>
					&nbsp&nbsp&nbsp&nbsp密码：
					<input name="user[pwd]" data-rule="required;password" placeholder="密码"/>
				</p>
			</fieldset>
			<button type="submit">
				提交
			</button>
		</form>

		<hr/>
		<h3>2、设置显示替换名</h3>
		<form id="demo_13" action="results.php" method="post" autocomplete="off"
		data-validator-option="{theme:'yellow_right_effect',stopOnError:true}">
			<fieldset>
				<p>
					用户名：
					<input name="username" data-rule="用户名:required;username" placeholder="用户名">
				</p>
				<p>
					&nbsp&nbsp&nbsp&nbsp密码：
					<input name="password" data-rule="密码:required;password" placeholder="密码">
				</p>
			</fieldset>
			<button type="submit">
				提交
			</button>
		</form>

		<hr/>

		<h3>3、自定义规则</h3>
		<form id="demo_13" action="results.php" method="post" autocomplete="off"
		data-validator-option="{theme:'yellow_right_effect',stopOnError:true}">
			<fieldset>
				<p>
					自定义规则：
					<input name="demo" data-rule="密码:required; define" data-rule-define="[/^\d{6}$/, '请输入6位数字']" data-tip="密码由6位数字组成" data-ok=" 别担心，稍后您还可以更改"  >
				</p>
				<div id="info"></div>
			</fieldset>
			<button type="submit">
				提交
			</button>
		</form>

	</body>
</html>
